Credits: If you would like to include the hacking minigames that are from Hacking Minigames in SP feel free to do so, please just give credit to HKH191. 

Adding Hacking Minigames in SP to you project: 
If your wanting to use a minigame to your mod you will need to reference Hacking Minigames in SP to your mod, you can do this via two ways. 
~Option A will make Hacking Minigames in SP a dependency to your mod. 
    ~Add Hacking Minigames To your Project Via Visual Studio: To add Hacking Minigames in SP as a dependency in Visual Studio, click on References > Add Reference > Browse > select Hacking Minigames in SP in your scripts Folder > then make sure Hacking Minigames in SP is ticked in Reference Manager. 

~Option B will make it an optional extra, using this option you can effectively keep the minigames optional to use in your mod. 
   ~Add Hacking Minigames To your Project (Option B): All you need to is have Hacking Minigames in SP.dll in your scripts folder

Depending on what Option you choose your way of calling the methods will be different 

Methods: 
void ToggleHackMinigame(Class1.HackMinigame)
bool HasHackCompleted()
bool HasHackExited()
bool HasHackFailed()
void CleanupHacks()

For Option A, calling methods would look like: 
~HackingMinigamesInSP.Class1.ToggleHackMinigame(Class1.HackMinigame.None)
~HackingMinigamesInSP.Class1.HasHackCompleted()
~HackingMinigamesInSP.Class1.HasHackExited()
~HackingMinigamesInSP.Class1.HasHackFailed()
~HackingMinigamesInSP.Class1.CleanupHacks()

Option B requires Reflection: 
Make sure your script file has:
~using System.IO;
~using System.Reflection;

here is all methods accessed though reflection: 


//check if Hacking Minigames in SP is present in scripts
 public static bool IsHackingMinigamesInSPInstalled()
 {
     return File.Exists("scripts//HackingMinigamesInSP.dll");
 }
   public enum HackMinigame
   {
       None=-1,
       Bruteforce_Numbers,
       Bruteforce_Password,
       Bruteforce_Both,
       Datacrack_Bars,
       Fingerprint_Casino,
       Dots_Casino,
       Voltage_Hack_Cayo,
       Fingerprint_Cayo,
       Circuit_Block_Fleeca,
       PCB_FIB_Files,
       Five_Letter_FIB_Files,
       Beam_Hack_Doomsday_Heist,
       Hotwire_Doomsday_Heist,
   }

  public static void ToggleHackMinigame(HackMinigame Hack)
  {
     
      if (IsHackingMinigamesInSPInstalled())
      {
          Assembly DLL = Assembly.LoadFrom("scripts/HackingMinigamesInSP.dll");
          Type Method = DLL.GetType("HackingMinigamesInSP.Class1");
          MethodInfo MethodInfo = Method.GetMethod("ToggleHackMinigame");
          object[] parametersArray = new object[] { (int)Hack };
          MethodInfo.Invoke(MethodInfo, parametersArray);
      }

     
  }

  public static bool HasHackCompleted()
  {
      bool Completed = false;
      if (IsHackingMinigamesInSPInstalled())
      {
          Assembly DLL = Assembly.LoadFrom("scripts/HackingMinigamesInSP.dll");
          Type Method = DLL.GetType("HackingMinigamesInSP.Class1");
          MethodInfo MethodInfo = Method.GetMethod("HasHackCompleted");
          Completed = (bool)MethodInfo.Invoke(MethodInfo, null);
      }

      return Completed;
  }
  public static bool HasHackExited()
  {
      bool Exited = false;
      if (IsHackingMinigamesInSPInstalled())
      {
          Assembly DLL = Assembly.LoadFrom("scripts/HackingMinigamesInSP.dll");
          Type Method = DLL.GetType("HackingMinigamesInSP.Class1");
          MethodInfo MethodInfo = Method.GetMethod("HasHackExited");
          Exited = (bool)MethodInfo.Invoke(MethodInfo, null);
      }

      return Exited;
  }  

  public static bool HasHackFailed()
  {
      bool Failed = false;
      if (IsHackingMinigamesInSPInstalled())
      {
          Assembly DLL = Assembly.LoadFrom("scripts/HackingMinigamesInSP.dll");
          Type Method = DLL.GetType("HackingMinigamesInSP.Class1");
          MethodInfo MethodInfo = Method.GetMethod("HasHackFailed");
          Failed = (bool)MethodInfo.Invoke(MethodInfo, null);
      }

      return Failed;
  }
  public static void CleanupHacks()
  {
     
      if (IsHackingMinigamesInSPInstalled())
      {
          Assembly DLL = Assembly.LoadFrom("scripts/HackingMinigamesInSP.dll");
          Type Method = DLL.GetType("HackingMinigamesInSP.Class1");
          MethodInfo MethodInfo = Method.GetMethod("CleanupHacks");
          MethodInfo.Invoke(MethodInfo, null);
      }

     
  }